package com.longrise.android.byjk.advertisement.utils;

import com.longrise.android.byjk.advertisement.admanager.ADConstants;

import java.io.File;

/**
 * Created by callxkj on 2016/12/14.
 * 广告的文件工具类
 */

public class ADFileUtil {

    private static String mRootDir;
    /**
     * 初始化文件夹
     * @param rootDir 软件的根目录
     */
    public static void initFolder(String rootDir){
        mRootDir = rootDir;
        createFolder(rootDir+ADConstants.INTERSTITIAL_DIR);
    }

    /**
     * 获取插屏广告文件夹地址
     */
    public static String getInterstitialFolderPath(){
        return mRootDir+ADConstants.INTERSTITIAL_DIR;
    }

    public static void createFolder(String folderName) {
        File folder = new File(folderName);
        if (!folder.exists()) {
            if (!folder.isDirectory()) {
                folder.mkdirs();
            }
        }
    }
}
